package com.exam.role.dao.impl;

import java.util.List;

import com.exam.base.dao.BaseDao;
import com.exam.role.dao.TeacherDao;
import com.exam.role.model.Teacher;

public class TeacherDaoImpl extends BaseDao<Teacher> implements TeacherDao {

	@Override
	public Teacher getTeacher(String userName) {
		List<Teacher> list = this.findByHql(
				" from Teacher t where t.uname = ?", new Object[] { userName });
		if (list != null && list.size() > 0) {
			return (Teacher) list.get(0);
		}
		return null;
	}

}
